//===========================================
// AirCrash Game Engine
// Effect Class
//===========================================

#ifndef EFFECT_CLASS
#define EFFECT_CLASS

class Effect
{
public:
	Effect(const tstring& file);
	virtual ~Effect();

	void SetMatrixen(const D3DXMATRIX& world, const D3DXMATRIX& view, const D3DXMATRIX& proj);
	void SetLightWVP(const D3DXMATRIX& lightWVP);
	void SetTexture(const ID3D10ShaderResourceView* texture);
	void SetLight(const D3DXVECTOR3& pos, const D3DXVECTOR4& color, const D3DXVECTOR4& spec, const D3DXVECTOR4& ambient);
	void SetEyePos(const D3DXVECTOR3& eyePos);
	void ResetShader();
	void SetShadowMap(const ID3D10ShaderResourceView* shadow);
	void SetTexScale(float rows, float cols);

	ID3D10EffectTechnique* GetTech() const;

private:
	ID3D10Effect* m_Effect;
	ID3D10EffectTechnique* m_Techniek;

	D3DXMATRIX m_View, m_Proj;

	ID3D10EffectMatrixVariable* m_WorldVar, *m_WVPVar, *m_LightWVPVar, *m_TexMatVar;
	ID3D10EffectVectorVariable* m_LightPos, *m_LightColor, *m_LightSpec, *m_LightAmbient, *m_EyePosVar;
	ID3D10EffectShaderResourceVariable* m_TextureVar, *m_ShadowMapVar;

	Effect(const Effect &t);
	Effect& operator= (const Effect &t);
};
#endif